<template>
  <div id="">
    <TypeNav></TypeNav>
    <List></List>
    <Recommend></Recommend>
    <Rank></Rank>
    <Like></Like>
    <Floor
      v-for="(floor, index) in floorArr"
      :key="index"
      :floor="floor"
    ></Floor>
    <Brand></Brand>
  </div>
</template>

<script>
import List from "./list";
import Recommend from "./recommend";
import Rank from "./rank";
import Like from "./like";
import Floor from "./floor";
import Brand from "./brand";
import { mapState } from "vuex";
export default {
  name: "Home",
  components: {
    List,
    Recommend,
    Rank,
    Like,
    Floor,
    Brand,
  },
  data() {
    return {};
  },
  methods: {},
  computed: {
    ...mapState({
      floorArr: (state) => state.home.floorArr,
    }),
  },
  mounted() {
    this.$store.dispatch("getFloor");
    //获取用户信息
    if (this.$store.state.user.token) {
      this.$store.dispatch("getUserInfo");
    }
  },
};
</script>

<style scoped lang="">
</style>